import 'package:flutterstudyapplast/business/models/article_item.dart';
import 'package:flutterstudyapplast/business/models/banner_item.dart';
import 'package:flutterstudyapplast/services/api/api.dart';
import 'package:flutterstudyapplast/services/article/article_service.dart';
import 'package:flutterstudyapplast/services/service_locator.dart';

import '../http_helper.dart';

class ArticleServiceImpl extends ArticleService{
  Api _apiImpl = serviceLocator<Api>();
  @override
  Future<Map<String,dynamic>> getArticleList(int page) async{
    // TODO: implement getArticleList
    var model = await _apiImpl.getArticleList(page);
    if(model != null){
      ///toto 可能对model进行操作
      return HttpHelper.createArticleList(model);
    }
    return null;
  }

  @override
  Future<List<BannerItem>> getBanner() async{
    // TODO: implement getBanner
    return await _apiImpl.getBanner();
  }

}